﻿Imports System.ComponentModel

Public Class frmLHJDetail
    Private _lhjID As String '硫化机ID
    Private _prodID As String '生产编号
    Private objHWSetting As New clsHWSetting
    Public Property LhjID As String
        Get
            Return _lhjID
        End Get
        Set(value As String)
            _lhjID = value
        End Set
    End Property

    Private Sub frmLHJDetail_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Text = Me.Text & "---"& LhjID

        getLHJData()
        TmLHJ.Start()
    End Sub

    Private Sub getLHJData()
        Dim objWorkDetail As New clsLHJWorkDetail
        Dim dtLHJ As DataTable = objHWSetting.selectForLHJByID(g_ws_lh, _lhjID)
        If dtLHJ.Rows.Count > 0 Then
            Dim dt As DataTable = objWorkDetail.selectLHJWorkDetailInfoDESC(LhjID, dtLHJ.Rows(0)("prod_id"))
            If dt.Rows.Count > 0 Then
                dgv.AutoGenerateColumns = False

                dgv.DataSource = dt
            Else
                dgv.DataSource = Nothing
            End If
        Else
            dgv.DataSource = Nothing
        End If

    End Sub

    Private Sub TmLHJ_Tick(sender As Object, e As EventArgs) Handles TmLHJ.Tick
        getLHJData()
    End Sub


    Private Sub frmLHJDetail_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
        TmLHJ.Stop()
    End Sub
End Class